import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { lotpayrecordVO, lotpayrecordForm, lotpayrecordQuery } from '@/api/parkinglot/lotPayRecord/types';

/**
 * 查询停车场-支付记录列表
 * @param query
 * @returns {*}
 */

export const listlotpayrecord = (query?: lotpayrecordQuery): AxiosPromise<lotpayrecordVO[]> => {
  return request({
    url: '/parkinglot/lotPayRecord/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询停车场-支付记录详细
 * @param parkingLotPayRecordId
 */
export const getlotpayrecord = (parkingLotPayRecordId: string | number): AxiosPromise<lotpayrecordVO> => {
  return request({
    url: '/parkinglot/lotPayRecord/' + parkingLotPayRecordId,
    method: 'get'
  });
};

/**
 * 新增停车场-支付记录
 * @param data
 */
export const addlotpayrecord = (data: lotpayrecordForm) => {
  return request({
    url: '/parkinglot/lotPayRecord',
    method: 'post',
    data: data
  });
};

/**
 * 修改停车场-支付记录
 * @param data
 */
export const updatelotpayrecord = (data: lotpayrecordForm) => {
  return request({
    url: '/parkinglot/lotPayRecord',
    method: 'put',
    data: data
  });
};

/**
 * 删除停车场-支付记录
 * @param parkingLotPayRecordId
 */
export const dellotpayrecord = (parkingLotPayRecordId: string | number | Array<string | number>) => {
  return request({
    url: '/parkinglot/lotPayRecord/' + parkingLotPayRecordId,
    method: 'delete'
  });
};
